package hu.cskassai.sad.business.vo;

import hu.cskassai.sad.model.graph.Edge;

import com.thoughtworks.xstream.annotations.XStreamAlias;

@XStreamAlias(value = "edge")
public class EdgeVO {
	
	private String id;
	
	private final String fromVertexId;
	
	private final String toVertexId;
	
	private double weight;
	
	public EdgeVO(final Edge edge) {
		super();
		id = edge.getId().toString();
		fromVertexId = edge.getFromVertex().getId().toString();
		toVertexId = edge.getToVertex().getId().toString();
		weight = edge.getWeight().doubleValue();
	}
	
	public String getId() {
		return id;
	}
	
	public void setId(final String id) {
		this.id = id;
	}
	
	public double getWeight() {
		return weight;
	}
	
	public void setWeight(final double weight) {
		this.weight = weight;
	}
	
	public String getFromVertexId() {
		return fromVertexId;
	}
	
	public String getToVertexId() {
		return toVertexId;
	}
	
}
